<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAttributesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('attributes', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('名称');
            $table->string('attr')->nullable()->comment('属性字段');
            $table->string('uniqueid')->nullable()->comment('唯一标识');
            $table->integer('parent_id')->default(0)->comment('上级ID');
            $table->integer('sort')->default(0)->comment('排序');
            $table->string('map')->nullable()->comment('区域坐标');
            $table->string('longitude')->nullable()->comment('经度');
            $table->string('latitude')->nullable()->comment('纬度');
            $table->tinyInteger('attr_type')->default(1)->unsigned()->comment('类型');
            $table->string('status')->default('T')->comment('状态：T 启用 F 不启用');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('attributes');
    }
}
